<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
    return view('welcome');
});

Route::group(['middleware' => 'login'],function(){


Route::get('admin/index',"Admin\IndexController@index");

Route::get('/admin/user/add','Admin\UserController@add');

Route::post('/admin/user/insert','Admin\UserController@insert');

Route::get('/admin/user/index','Admin\UserController@index');

Route::post('/admin/user/ajaxStatus','Admin\UserController@ajaxStatus');

Route::post('/admin/user/ajaxName','Admin\UserController@ajaxName');

Route::get('/admin/user/edit/{id}','Admin\UserController@edit');

Route::post('/admin/user/update','Admin\UserController@update');

Route::get('/admin/user/delete/{id}','Admin\UserController@delete');

//分类管理
Route::resource('/admin/category','Admin\CategoryController');

//文章控制器
Route::controller('admin/article','Admin\ArticleController');



});




//登陆
Route::get('/admin/login','Admin\LoginController@login');

//验证码
Route::get('/admin/captcha/{tmp}','CodeController@captcha');

Route::post('/admin/doLogin','Admin\LoginController@dologin');

Route::get('/admin/logout','Admin\LoginController@logout');
                         
//找回密码
Route::get('/admin/forget','Admin\ForgetController@forget');

Route::post('/admin/forget/sendEmail','Admin\ForgetController@sendEmail');

Route::post('/admin/forget/reset/{id}/{remember_token}','Admin\ForgetController@reset');

Route::get("/admin/forget/info",'Admin\ForgetController@info');

Route::get('/admin/forget/info','Admin\ForgetController@info');
Route::post('/admin/forget/repass','Admin\ForgetController@repass');